package com.mybatis.mybatisdatab.config;

import com.mybatis.mybatisdatab.interceptor.MyInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//配置自定义拦截器
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    //实现并重写方法

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**");
    }
}
